package com.binance.mbxgateway.web.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.binance.mbxgateway.vo.ApiKeyInfoVo;
import com.binance.mbxgateway.vo.response.BlanceLedgerResponse;
import com.binance.mbxgateway.vo.response.TradingAccountResponse;

/**
 * @author wangxiao
 */
public interface IAccountService {

    /**
     * 查询撮合出入金
     * 
     * @param userId
     * @param asset
     * @param startTime
     * @param endTime
     * @return
     */
    public List<BlanceLedgerResponse> getBlanceLedger(String userId, String asset, Date startTime, Date endTime)
            throws Exception;

    /**
     * 解锁API交易
     * 
     * @param userId
     * @throws Exception
     */
    public void unlockApiTrade(String userId) throws Exception;


    /**
     * 锁定API交易
     * 
     * @param userId
     * @throws Exception
     */
    public void lockApiTrade(String userId) throws Exception;


    /**
     * 获取API签名验证
     * 
     * @param xMbxApiKey
     * @param userId
     * @param ip
     * @param payload
     * @param recvWindow
     * @param timestamp
     * @param signature
     * @return
     * @throws Exception
     */
    public ApiKeyInfoVo getApiCheck(String xMbxApiKey, String userId, String ip, String payload, Long recvWindow,
            Long timestamp, String signature) throws Exception;

    /**
     * 设置是否可以交易
     * 
     * @param userId
     * @param canTrade
     * @throws Exception
     */
    public void setTrade(String userId, Boolean canTrade) throws Exception;


    /**
     * 设置手续费GAS
     * 
     * @param userId
     * @param status
     * @throws Exception
     */
    public void setGas(String userId, Boolean isUseBnbFee) throws Exception;


    /**
     * 获取交易账户信息
     * 
     * @param userId
     * @return
     * @throws Exception
     */
    public TradingAccountResponse getAccount(String userId) throws Exception;

    public void activateAccount(String userId, Boolean canTrade, Boolean canWithdraw, Boolean canDeposit)
            throws Exception;


    /**
     * 设置返佣比例
     * 
     * @param userId
     * @param ratio
     * @throws Exception
     */
    public void setAgentFee(String userId, BigDecimal ratio) throws Exception;


    public void saveApiRule(String userId, String keyId, String ip) throws Exception;


    public void deleteRuleByRuleId(String userId, String keyId, String ruleId) throws Exception;


    public List<ApiKeyInfoVo> getApiInfo(String userId) throws Exception;



}
